<template>
    <div>
        <LogList v-if="initialized" :current-user="user" :tenant-id="tenant_id" :teams="teams" />
    </div>
</template>

<script setup lang="ts">
import { computed, inject, onMounted, ref } from 'vue';
import { useStore } from 'vuex';
import LogList from '../../../components/AI/AILog.vue';
import { Storekey } from '../../../interface';


const tenant_id = inject<string | undefined>("tenant_id", undefined);
const store = useStore(Storekey)
const user = computed(() => {
    // return store.getters.getuser;
    return store.state.user;
});
const teamId = computed(() => {
    return Number(user.value?.teamid)
})
const teams = computed(() => store.getters.getteam);

const initialized = ref(false);
onMounted(async () => {
    try {
        await store.dispatch('actionteam', { tenant_id });
        initialized.value = true;
    } catch (error) {
        console.error('初始化失败:', error);
    }
})
</script>